package org.springblade.oa.service;

import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import org.springblade.oa.entity.InvoiceImage;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @author LK
 * @version 1.0.0
 * @Title: IInvoiceImageService.java
 * @Description: TODO    发票图片服务接口
 * @date 2020/4/15 10:56
 */
public interface IInvoiceImageService extends BaseService<InvoiceImage> {

	/**
	 * 批量保存发票图片
	 *
	 * @param files
	 * @param invoiceImage
	 * @return
	 */
	@Transactional(
		rollbackFor = {Exception.class}
	)
	boolean saveBatch(MultipartFile[] files, InvoiceImage invoiceImage);

	/**
	 * 批量删除发票图片
	 *
	 * @param ids
	 * @return
	 */
	@Transactional(
		rollbackFor = {Exception.class}
	)
	boolean removeBatchByIds(String ids);

	/**
	 * 下载图片
	 *
	 * @param response
	 * @param id
	 * @return
	 */
	void downloadImage(HttpServletResponse response, String id);

	/**
	 * 图片预览
	 *
	 * @param response
	 * @param id
	 */
	void preView(HttpServletResponse response, String id);

	/**
	 * 批量下载
	 *
	 * @param response
	 * @param ids
	 */
	void downloadBatch(HttpServletResponse response, String ids,String zipName);

	@Transactional(
		rollbackFor = {Exception.class}
	)
	boolean uploadInvoicePdf(MultipartFile[] files, InvoiceImage invoiceImage);

	R isExistInvoicePdf(MultipartFile[] files);
}
